package cn.javass.dp.chianofresponsibility.example2;

/**
 * 不用模式
 * 处理聚餐费用申请对象
 */
public class FeeRequest {
    public String requestToProjectManager(String user, double fee) {
        String str = "";
        if (fee < 500) {
            str = this.projectHandle(user, fee);
        } else if (fee < 1000 && fee >= 500) {
            str = this.depManagerHandle(user, fee);
        } else if (fee >= 1000) {
            str = this.generalManager(user, fee);
        }
        return str;
    }

    private String generalManager(String user, double fee) {
        String str = "";
        if ("小李".equals(user)) {
            str = "总经理同意" + user + "聚餐费用" + fee + "请求";
        } else {
            str = "总经理不！！！同意" + user + "聚餐费用" + fee + "请求";

        }
        return str;
    }

    private String depManagerHandle(String user, double fee) {
        String str = "";
        if ("小李".equals(user)) {
            str = "部门经理同意" + user + "聚餐费用" + fee + "请求";
        } else {
            str = "部门经理不！！！同意" + user + "聚餐费用" + fee + "请求";

        }
        return str;
    }

    private String projectHandle(String user, double fee) {
        String str = "";
        if ("小李".equals(user)) {
            str = "项目经理同意" + user + "聚餐费用" + fee + "请求";
        } else {
            str = "项目经理不！！！同意" + user + "聚餐费用" + fee + "请求";

        }
        return str;
    }
}
